#ifndef POSTGRESQL_QUERY_RESULT_H
#define POSTGRESQL_QUERY_RESULT_H

#ifdef ENABLE_POSTGRESQL

#include "../include/database_query_result.h"
#include <libpq-fe.h>

namespace utility
{
namespace database
{
    class postgresql_fields_info : public fields_info
    {
    public:
        postgresql_fields_info(PGresult * res);
    };

    class postgresql_query_result : public query_result
    {
    public:
        typedef std::vector<row> list_type;

        postgresql_query_result(PGresult * res);

        ~postgresql_query_result(void);

        virtual uint32 get_field_count() const;

        virtual int32 get_field_index(const char * field_name) const;

    private:
        postgresql_fields_info * _fields_info;
    };
}
}

#endif // endif of ENABLE_POSTGRESQL

#endif // endif of POSTGRESQL_QUERY_RESULT_H
